package pers.cyril.jdb.client.command.validator;

import com.beust.jcommander.IParameterValidator;
import com.beust.jcommander.ParameterException;
import lombok.Data;

/**
 * 说点什么吧
 *
 * @author Wang Cyril
 * @date 2024/6/1 16:05
 */
@Data
public class NullParameterValidator implements IParameterValidator {

    private String message;

    public NullParameterValidator(String message) {
        this.message = message;
    }

    @Override
    public void validate(String name, String value) throws ParameterException {
        if(value == null){
            throw new ParameterException(message);
        }
    }
}
